package org.springframework.beanFactoryPostProcessor.config;

import org.springframework.beanFactoryPostProcessor.entity.BeanFactoryBean1;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @Author: T-jack
 * @Date: 2024-01-09-10:51
 * @Description: beanFactory 后处理器 配置类
 */
@Configuration
@ComponentScan("org.springframework.beanFactoryPostProcessor.entity")
public class BeanFactoryPostProcessorConfig {
	@Bean
	public BeanFactoryBean1 beanFactoryBean1() {
		return new BeanFactoryBean1();
	}

	/*@Bean
	public SqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource) {
		SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
		sqlSessionFactoryBean.setDataSource(dataSource);
		return sqlSessionFactoryBean;
	}

	@Bean(initMethod = "init")
	public DruidDataSource dataSource() {
		DruidDataSource dataSource = new DruidDataSource();
		dataSource.setUrl("jdbc:mysql://localhost:3306/springtest");
		dataSource.setUsername("root");
		dataSource.setPassword("TGQ@candywall123");
		return dataSource;
	}*/

}
